package StudyCode.summary.mycollection;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class ThisMethodConvertsABooleanArrayToAPrimitiveOne {
	public static boolean[] toPrimitive(Boolean[] array) {

		boolean[] primitiveArray = new boolean[array.length];

		for (int i = 0; i < array.length; i++) {
			primitiveArray[i] = array[i];
		}

		return primitiveArray;
	}

	public static byte[] toPrimitive(Byte[] array) {

		byte[] primitiveArray = new byte[array.length];

		for (int i = 0; i < array.length; i++) {
			primitiveArray[i] = array[i];
		}

		return primitiveArray;
	}

	public static short[] toPrimitive(Short[] array) {

		short[] primitiveArray = new short[array.length];

		for (int i = 0; i < array.length; i++) {
			primitiveArray[i] = array[i];
		}

		return primitiveArray;
	}

	public static int[] toPrimitive(Integer[] array) {

		int[] primitiveArray = new int[array.length];

		for (int i = 0; i < array.length; i++) {
			primitiveArray[i] = array[i];
		}

		return primitiveArray;
	}

	public static long[] toPrimitive(Long[] array) {

		long[] primitiveArray = new long[array.length];

		for (int i = 0; i < array.length; i++) {
			primitiveArray[i] = array[i];
		}

		return primitiveArray;
	}

	public static float[] toPrimitive(Float[] array) {

		float[] primitiveArray = new float[array.length];

		for (int i = 0; i < array.length; i++) {
			primitiveArray[i] = array[i];
		}

		return primitiveArray;
	}

	public static double[] toPrimitive(Double[] array) {

		double[] primitiveArray = new double[array.length];

		for (int i = 0; i < array.length; i++) {
			primitiveArray[i] = array[i];
		}

		return primitiveArray;
	}
}
